package com.equipment;

import com.util.EncodingUtil;

import android.R.string;

public class SystemRequst {
	// 帧开始标记
	private String STX = "55AA";
	// 串口帧序列号
	private String RSCTL = "00";
	// 长度
	private String Length = "";
	private String LEM = "";
	//
	private String CMD = "C0";
	// 异或效验值
	private String BCC = "";
	// 是否替换主控密钥，0为替换，1不替换 0
	private String UpdateMKey = "00";
	// 提供商编码后4字节
	private String ContractProvider2 = "";
	// 协约类型
	private String ContractType = "";
	// 合同版本 16
	private String ContractVersion = "";
	// 合同序列号
	private String ContractSerialNumber = "";

	public String command(String date) {
		// 长度
		Length = EncodingUtil.desToHex(
				(CMD + UpdateMKey + ContractProvider2 + ContractType
						+ ContractVersion + ContractSerialNumber).length() / 2,
				2);
		String DATA = RSCTL + LEM + CMD + UpdateMKey + ContractProvider2
				+ ContractType + ContractVersion + ContractSerialNumber;
		BCC = EncodingUtil.yihuo(DATA);
		String retn = STX + DATA + BCC;
		return retn;

	}

	public String getSTX() {
		return STX;
	}

	public void setSTX(String sTX) {
		STX = sTX;
	}

	public String getRSCTL() {
		return RSCTL;
	}

	public void setRSCTL(String rSCTL) {
		RSCTL = rSCTL;
	}

	public String getLength() {
		return Length;
	}

	public void setLength(String length) {
		Length = length;
	}

	public String getCMD() {
		return CMD;
	}

	public void setCMD(String cMD) {
		CMD = cMD;
	}

	public String getBCC() {
		return BCC;
	}

	public void setBCC(String bCC) {
		BCC = bCC;
	}

	public String getUpdateMKey() {
		return UpdateMKey;
	}

	public void setUpdateMKey(String updateMKey) {
		UpdateMKey = updateMKey;
	}

	public String getContractProvider2() {
		return ContractProvider2;
	}

	public void setContractProvider2(String contractProvider2) {
		ContractProvider2 = contractProvider2;
	}

	public String getContractType() {
		return ContractType;
	}

	public void setContractType(String contractType) {
		ContractType = contractType;
	}

	public String getContractVersion() {
		return ContractVersion;
	}

	public void setContractVersion(String contractVersion) {
		ContractVersion = contractVersion;
	}

	public String getContractSerialNumber() {
		return ContractSerialNumber;
	}

	public void setContractSerialNumber(String contractSerialNumber) {
		ContractSerialNumber = contractSerialNumber;
	}

}
